import 'package:fish_redux/fish_redux.dart';

enum PracticeVoiceAction {
  onVoiceAi,
  doneVoiceAi,
  recording,
  token,
  content,
  valid,
  onSubmit,
  selectType,
  selectGrade,
  focus,
}

class PracticeVoiceActionCreator {
  static Action selectType(String item) {
    return Action(PracticeVoiceAction.selectType, payload: item);
  }

  static Action selectGrade(String item) {
    return Action(PracticeVoiceAction.selectGrade, payload: item);
  }

  static Action onVoiceAi(String file) {
    return Action(PracticeVoiceAction.onVoiceAi, payload: file);
  }

  static Action doneVoiceAi(String newStr) {
    return Action(PracticeVoiceAction.doneVoiceAi, payload: newStr);
  }

  static Action token(String token) {
    return Action(PracticeVoiceAction.token, payload: token);
  }

  static Action onSubmit() {
    return Action(PracticeVoiceAction.onSubmit);
  }

  static Action focus(bool hasFocus) {
    return Action(PracticeVoiceAction.focus, payload: hasFocus);
  }
}
